package com.example.redisspringboot;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.Tuple;

import java.util.List;

public class RedisDemoString {
    public static void test1(Jedis jedis){
        System.out.println("mget和mset");
        jedis.flushAll();

        jedis.mset("key1","111","key2","222","key3","333");

        List<String> values = jedis.mget("key1", "key2", "key3");
        System.out.println("values " + values);
    }
    public static void main(String[] args) {
        JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");
        try (Jedis jedis = jedisPool.getResource()) {
            jedis.auth("123456");
            test1(jedis);
        }
    }
}
